{% extends 'maintemplate.html' %}
{% load hakaze_filters %}

{% block contents %}


{% if category %}
<div>
 <h2>   {{ category.name }} </h2>
</div>

{% if editcatform %}
<div>
        {% if editnsform.is_bound %}
        {% if not editnsform.is_valid %}
        <div class="errorbox">
        Errors:<br/>
        <ul>
        {% for felement in editnsform %}
        {% if felement.errors %} <li> {{ felement.label }} : {{ felement.errors }} </li> {% endif %}
        {% endfor %}
        </ul>
        </div>
        {% endif %}{% endif %}
<form method="post" action="{% url hakaze.forums.views.admineditview "category" %}?id={{ category.id }}">
{{ editcatform.formtype }}{{ editcatform.id }}
{{ editcatform.name.label }} : <br/>
{{ editcatform.name }}<br/>
{{ editcatform.priority.label }}<br/>
{{ editcatform.priority }} <br/>
    <input type="submit" value="Edit"/>
</form>
</div>
{% endif %}
{% endif %}


{% if channel %}
<div>
   <h2>{{ channel.name }}</h2>
   <blockquote>
   {{ channel.description|hakazefy:"" }}
   </blockquote>
</div>


{% if editnsform %}
<div>
        {% if editnsform.is_bound %}
        {% if not editnsform.is_valid %}
        <div class="errorbox">
        Errors:<br/>
        <ul>
        {% for felement in editnsform %}
        {% if felement.errors %} <li> {{ felement.label }} : {{ felement.errors }} </li> {% endif %}
        {% endfor %}
        </ul>
        </div>
        {% endif %}{% endif %}

<form method="post" action="{% url hakaze.forums.views.admineditview "channel" %}?codename={{ channel.codename }}">
    {{ editnsform.origcodename }} {{ editnsform.formtype }}
    {{ editnsform.codename.label }} :<br/>
    {{ editnsform.codename }}<br/>
    {{ editnsform.name.label }} : <br/>
    {{ editnsform.name }}<br/>
    {{ editnsform.description.label }} : <br/>
    {{ editnsform.description }}<br/>
    {{ editnsform.category.label }} : <br/>
    {{ editnsform.category }}<br/>
    {{ editnsform.priority.label }} : <br/>
    {{ editnsform.priority }}<br/>
    <input type="submit" value="Edit"/>
</form>
</div>
{% endif %}


{% endif %}


{% if catlist %}
<div>
<h1> Categories </h1>
   <ul>
   {% for c in catlist %}
      <li><a href="{% url hakaze.forums.views.admineditview "category" %}?id={{ c.id }}">{{ c.name }}</a></li>
   {% endfor %}
  </ul>
</div>
{% endif %}

{% if nslist %}
<div> 
<h1> Channels </h1>
   <ul>
   {% for n in nslist %}
      <li> <a href="{% url hakaze.forums.views.admineditview "channel" %}?codename={{ n.codename }}">{{ n.codename }}  </a></li>
   {% endfor %}
   </ul>
</div>
{% endif %}

{% endblock contents %}
